package system.controller;

import common.controller.base.BaseController;
import common.model.response.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import system.model.vo.UserInfo;
import system.service.SystemCommonService;

import javax.annotation.Resource;

/**
 * 公共接口，任意登录用户可以访问
 *
 * @author 米泽鹏
 * @since 2022-03-11
 */
@Api(value = "公共接口", tags = "公共接口，任意登录用户可以访问")
@RestController
@RequestMapping("/system/common")
public class SysCommonController extends BaseController {

	@Resource
	private SystemCommonService systemCommonService;

	@ApiOperation(value = "用户名片信息查询", notes = "用户名片信息查询", response = Result.class)
	@GetMapping("/getUserCardInfo/{userId}")
	public Result<UserInfo> getUserCardInfo(@ApiParam(value = "用户id", required = true) @PathVariable Long userId) {
		return successWithData(systemCommonService.getUserInfo(userId));
	}

}
